<!DOCTYPE HTML>

<html>

<head>
	<title>奇幻之岛</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="content-language" content="zh-CN" />
	<script language="javascript" src="js/md5.js"></script>
	<script language='javascript'>
	<!--
		function comparePassword() {
			var ctl_newpwd=document.getElementById("newpwd");
			var ctl_repeat=document.getElementById("repeat");
			if (ctl_newpwd.value!=ctl_repeat.value)
			{
				document.getElementById('tip').style.display="";
			}
			else {
				document.getElementById('tip').style.display="none";
			}
		}
		function submitUserPassword() {
			var ctl_oldpwd=document.getElementById("oldpwd");
			var ctl_newpwd=document.getElementById("newpwd");
			var oldpwd=MD5(ctl_oldpwd.value);
			var newpwd=MD5(ctl_newpwd.value);
			var ctrl_backform=document.getElementById("back");
			var ctrl_user2=document.getElementById("user2");
			var ctrl_oldpwd2=document.getElementById("oldpwd2");
			var ctrl_newpwd2=document.getElementById("newpwd2");
			ctrl_user2.value=document.getElementById("user").value;
			ctrl_oldpwd2.value=oldpwd;
			ctrl_newpwd2.value=newpwd;
			ctrl_backform.submit();
			/*
			// DEBUG输出
			var text=document.getElementById('out');
			text.value="oldpwd: ";
			text.value+=oldpwd;
			text.value+="\n";
			text.value+="newpwd: ";
			text.value+=newpwd;
			*/
		}
	-->
	</script>
</head>

<body>
	<h2>PhotoDiary帐号管理</h2>
	<form>
		<p><b style='margin-right: 2em'>用户名</b><input id='user' name='user' type='text' size='16' maxlength=16></p>
		<p><b style='margin-right: 2em'>旧密码</b><input id='oldpwd' name='oldpwd' type='password' size='16' maxlength=16></p>
		<p><b style='margin-right: 2em'>新密码</b><input id='newpwd' name='newpwd' type='password' size='16' maxlength=16></p>
		<p><b style='margin-right: 1em'>确认密码</b><input id='repeat' name='repeat' onkeyup='comparePassword();' type='password' size='16' maxlength=16><span id='tip' style='display:none;  margin-left:0.5em;'>不一致</span></p>
		<p style='margin-left:10em;'><input id='submit' onclick='submitUserPassword(); return false;' type='submit' value='确定'/></p>
	</form>
	<form id='back', action="http://localhost:8080/password", method='post'>
		<input id='user2' name='user' type='hidden'>
		<input id='oldpwd2' name='oldpwd' type='hidden'>
		<input id='newpwd2' name='newpwd' type='hidden'>
	</form>
	<!--DEBUG输出-->
	<!--div style='clear:both;'><textarea id='out' rows='8' cols='48'></textarea></div-->
</body>

</html>